﻿<%@ Page Language="C#" MasterPageFile="~/SalesOneWeb.Master" AutoEventWireup="true" CodeBehind="VerifyCollectionTransactionDetails.aspx.cs" Inherits="IronOne.SalesOne.SalesOneWeb.Collection.VerifyCollectionTransactionDetails" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <script type="text/javascript">
        var TotalChkBx;
        var Counter;

        var TotalChkBx1;
        var Counter1;
        
        window.onload = function() {
            //Get total no. of CheckBoxes in side the GridView.
            TotalChkBx = parseInt('<%= this.GridVCash.Rows.Count %>');
            TotalChkBx1 = parseInt('<%= this.GridVCheque.Rows.Count %>');
            //Get total no. of checked CheckBoxes in side the GridView.
            Counter = 0;
            Counter1 = 0;
        };

               function HeaderClick(CheckBox) {
            //Get target base & child control.
            var TargetBaseControl = document.getElementById('<%= this.GridVCash.ClientID %>');
            var TargetChildControl = "CheckBox1";

            //Get all the control of the type INPUT in the base control.
            var Inputs = TargetBaseControl.getElementsByTagName("input");

            //Checked/Unchecked all the checkBoxes in side the GridView.
            for (var n = 0; n < Inputs.length; ++n)
                if (Inputs[n].type == 'checkbox' && Inputs[n].id.indexOf(TargetChildControl, 0) >= 0)
                Inputs[n].checked = CheckBox.checked;
            //Reset Counter
            Counter = CheckBox.checked ? TotalChkBx : 0;
        }

        function ChildClick(CheckBox, HCheckBox) {
            //get target base & child control.
            var HeaderCheckBox = document.getElementById(HCheckBox);

            //Modifiy Counter;            
            if (CheckBox.checked && Counter < TotalChkBx)
                Counter++;
            else if (Counter > 0)
                Counter--;

            //Change state of the header CheckBox.
            if (Counter < TotalChkBx)
                HeaderCheckBox.checked = false;
            else if (Counter == TotalChkBx)
                HeaderCheckBox.checked = true;
        }


        function HeaderClick1(CheckBox) {
            //Get target base & child control.
            var TargetBaseControl = document.getElementById('<%= this.GridVCheque.ClientID %>');
            var TargetChildControl = "CheckBox1";

            //Get all the control of the type INPUT in the base control.
            var Inputs = TargetBaseControl.getElementsByTagName("input");

            //Checked/Unchecked all the checkBoxes in side the GridView.
            for (var n = 0; n < Inputs.length; ++n)
                if (Inputs[n].type == 'checkbox' && Inputs[n].id.indexOf(TargetChildControl, 0) >= 0)
                Inputs[n].checked = CheckBox.checked;
            //Reset Counter
            Counter = CheckBox.checked ? TotalChkBx : 0;
        }

        function ChildClick1(CheckBox, HCheckBox) {
            //get target base & child control.
            var HeaderCheckBox = document.getElementById(HCheckBox);

            //Modifiy Counter;            
            if (CheckBox.checked && Counter < TotalChkBx)
                Counter++;
            else if (Counter > 0)
                Counter--;

            //Change state of the header CheckBox.
            if (Counter < TotalChkBx)
                HeaderCheckBox.checked = false;
            else if (Counter == TotalChkBx)
                HeaderCheckBox.checked = true;
        }
        
    </script>

    <script language="javascript" type="text/javascript">

        window.onload = function() {

            var msg = document.getElementById('ctl00_MasterMsg');
            if (msg && msg.innerHTML != '')
                showMessageBlock();
        };
        function DoConfirm() 
            {
                if (confirm('Confirm to cancel the transacion/s?')) 
                {
                    return true;
                }
                else {
                    return false;
                }
            }
        
        </script>



 <style type="text/css">
        
        .style6
     {
         width: 81px;
     }
    </style>

   
      
    <link href="../StyleSheets/salesOne_txtstyle.css" rel="stylesheet" type="text/css" />
  
    </asp:Content>

    
        

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    
        <table class="detailstable">
            <tr>
                <td>
                    <table class="detailstable">
                        <tr>
                            <td colspan="5" style="font-weight: bold">
                                CSS Details</td>
                        </tr>
                        <tr>
                            <td colspan="5" class="pix8">
                                </td>
                        </tr>
                        <tr>
                            <td width="100">
                                SO Code:</td>
                            <td>
                                <asp:Label ID="lblSocode" runat="server" CssClass="lbl">00033685</asp:Label>
                            </td>
                            <td width="130"></td>
                            <td width="100">
                                CSS NO:</td>
                            <td>
                                <asp:Label ID="lblCssno" runat="server" CssClass="lbl">C000002</asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Last Sync Date:</td>
                            <td>
                                <asp:Label ID="lblLastSyncDate" runat="server" CssClass="lbl">04/07/2008</asp:Label>
                            </td>
                            <td>
                                &nbsp;</td>
                            <td>
                                Last Sync Time:</td>
                            <td>
                                <asp:Label ID="lblLastSyncTime" runat="server" CssClass="lbl">17:05:2009</asp:Label>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            
            <tr>
                <td>
                <table id=TblCash runat=server>
                    <tr>
                    <td class="pix12"></td>
                    </tr>
                    <tr>
                    <td class="ph5">Cash</td>
                    </tr>
                    <tr>
                    <td class="pix8" ></td>
                    </tr>
                        <tr>
                    <td>                    
                        <asp:GridView ID="GridVCash" runat="server" BackColor="#907977"
                        BorderColor="#907977"  BorderWidth="1px" CellPadding="3" GridLines="Vertical" 
                            AutoGenerateColumns="False" OnRowDataBound="GridVCash_RowDataBound" 
                            onrowcreated="GridVCash_RowCreated" >
                        <EmptyDataTemplate>
                        <table class="table01" cellspacing="0" cellpadding="0" border="0">
                       
                            <tr class="tdbackground01">
                                <td >
                                    &nbsp;
                                </td>
                                <td >
                                    Receipt No</td>
                                <td >
                                    Contract No / Client ID</td>
                                <td >
                                    Loan Interest (Rs:)</td>
                                <td >
                                    AMT (Rs:)</td>
                                <td >
                                    Collection Type</td>
                                <td >
                                    Status</td>
                                <td >
                                    Verified By</td>
                                <td >
                                    Verified Date</td>
                                <td >
                                    Banked Status</td>
                                <td >
                                    Remarks</td>
                            </tr>
                        </table>
                    </EmptyDataTemplate>
                        <RowStyle BackColor="#f6f6f6" ForeColor="#4A3C8C" BorderWidth="1px" BorderColor="#907977" BorderStyle="solid"/>
                            <Columns>
                                
                                    <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="false" CssClass=" rdbtn" />
                                    </ItemTemplate>
                                    <HeaderTemplate>
                                        <asp:CheckBox ID="chkBxHeader" 
                                            onclick="javascript:HeaderClick(this);" runat="server" ToolTip="Select All" />
                                    </HeaderTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Receipt No">
                                    <ItemTemplate>
                                        <%--<asp:HyperLink ID="lnkReceiptNo" runat="server"></asp:HyperLink>--%>
                                        <asp:LinkButton ID="lnkReceiptNo" Visible="false" runat="server">LinkButton</asp:LinkButton>
                                         <a href="#" onclick='javascript:window.open("ReceiptDatails.aspx?RecNo=<%#Eval("ReceiptNo")%>&SOCode=<%# GetSOCode() %>","Popup","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width=350,height=500,left=100, top=100,screenX=100,screenY=100");return false;' 
                                        title='<%#Eval("ReceiptNo")%>'> <%#Eval("ReceiptNo")%></a>
                                       
                                    </ItemTemplate>
                                </asp:TemplateField>
                                
                                <asp:TemplateField HeaderText="Contract No /Client ID" HeaderStyle-Width="70px">
                                <ItemTemplate>
                                    <asp:TextBox ID="txtContr_ClientID" runat="server" Width="90%" Text="" CssClass="lbl">
                                    </asp:TextBox>
                                </ItemTemplate>

<HeaderStyle Width="70px"></HeaderStyle>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Loan Interest (Rs)" HeaderStyle-Width="70px">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txtLoanAmt" runat="server" Width="90%" Text="" CssClass="lbl"></asp:TextBox>
                                    </ItemTemplate>

<HeaderStyle Width="70px"></HeaderStyle>
                                </asp:TemplateField>
                                <asp:BoundField HeaderText="AMT(Rs.) " DataField="CollectionAmount" />
                                <asp:BoundField HeaderText="Collection Type" DataField="CollectionType"/>
                                <asp:BoundField HeaderText="Status" DataField="Status"/>
                                <asp:BoundField HeaderText="Verified By" DataField="VerifiedBy"/>
                                <asp:BoundField HeaderText="Verified Date" DataField="VerifiedDate"/>
                                <asp:TemplateField HeaderText="Banked Status" HeaderStyle-Width="50px">
                                    <ItemTemplate>
                                        <asp:DropDownList ID="ddlBankStatus" runat="server" CssClass="lbl" Width="100%">
                                            <asp:ListItem Selected="True">Yes</asp:ListItem>
                                            <asp:ListItem>No</asp:ListItem>
                                        </asp:DropDownList>
                                    </ItemTemplate>

<HeaderStyle Width="50px"></HeaderStyle>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Remarks">
                                    <ItemTemplate>
                                        <asp:HyperLink ID="lnkRemarks" runat="server" NavigateUrl="~/Collection/TransactionRemarkDetails.aspx">Details</asp:HyperLink>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
                            <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
                            <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
                            <HeaderStyle BackColor="#ae5044" Font-Bold="True" ForeColor="#F7F7F7"  />
                            <EditRowStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" />
                            <AlternatingRowStyle BackColor="#cacbcf" />
                        </asp:GridView>
                    </td>
                </tr>
                        <tr>
                    <td align="center">
                        <asp:Label ID="Label1" runat="server" Text="Total For Cash(Rs): "></asp:Label><asp:Label ID="lblCashAmt" runat="server" Text=""></asp:Label>
                    </td>
                </tr>
                        <tr>
                            <td>
                                &nbsp;</td>
                        </tr>
                </table>
                </td>
            </tr>
            <tr>
                <td>
                    <table id="TblCheque" runat="server">
                        <tr>
                            <td class="ph5">Cheque</td>
                        </tr>
                        <tr>
                            <td class="pix8" ></td>
                        </tr>
                    <tr>
                    <td>                     
                    <asp:GridView ID="GridVCheque" runat="server" BackColor="#907977" 
                    BorderColor="#907977"  BorderWidth="1px" CellPadding="3" GridLines="Vertical" 
                        AutoGenerateColumns="False" OnRowDataBound="GridVCheque_RowDataBound" 
                            onrowcreated="GridVCheque_RowCreated" >
                    <EmptyDataRowStyle BackColor="#ae5044" Font-Bold="True" ForeColor="#F7F7F7"/>
                    <EmptyDataTemplate>
                        <table border="0" class="table01" cellspacing="0" cellpadding="0">
                       
                            <tr class="tdbackground01">
                            <td >
                                &nbsp;</td>
                            <td >
                                Receipt No</td>
                            <td >
                                Contract No / Client ID</td>
                            <td >
                                Loan Interest (Rs:)</td>
                            <td >
                                AMT (Rs:)</td>
                            <td >
                                Collection Type</td>
                            <td >
                                Cheque Details</td>
                            <td >
                                Status</td>
                            <td >
                                Verified By</td>
                            <td >
                                Verified Date</td>
                            <td >
                                Banked Status</td>
                            <td >
                                Remarks</td>
                        </tr>
                        </table>
                    </EmptyDataTemplate>
                    <RowStyle BackColor="#f6f6f6" ForeColor="#4A3C8C" BorderWidth="1px" BorderColor="#907977" BorderStyle="solid"/>
                        <Columns>
                        
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="false" CssClass=" rdbtn" />
                                </ItemTemplate>
                                <HeaderTemplate>
                                      <asp:CheckBox ID="chkBxHeader" 
                                          onclick="javascript:HeaderClick1(this);" runat="server" ToolTip="Select All" />
                                </HeaderTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Receipt No">
                                <ItemTemplate>
                                    <%--<asp:HyperLink ID="lnkReceiptNo" runat="server" NavigateUrl="">kkk</asp:HyperLink>--%>
                                    <asp:LinkButton ID="lnkReceiptNo" Visible="false" runat="server">LinkButton</asp:LinkButton>
                                    <a href="#" onclick='javascript:window.open("ReceiptDetailsCheques.aspx?RecNo=<%#Eval("ReceiptNo")%>&SOCode=<%# GetSOCode() %>","Popup","toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width=350,height=500,left=100, top=100,screenX=100,screenY=100");return false;' 
                                        title='<%#Eval("ReceiptNo")%>'> <%#Eval("ReceiptNo")%></a>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Contract No /Client ID" HeaderStyle-Width="70px">
                                <ItemTemplate>
                                    <asp:TextBox ID="txtContr_ClientID" runat="server" Width="90%" CssClass="lbl"></asp:TextBox>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Loan Interest (Rs)" HeaderStyle-Width="70px">
                                <ItemTemplate>
                                    <asp:TextBox ID="txtLoanAmt" runat="server" Width="90%" Text="" CssClass="lbl"></asp:TextBox>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="AMT(Rs.)" DataField="CollectionAmount" />
                            <asp:BoundField HeaderText="Collection Type" DataField="CollectionType"/>
                            <%--<asp:BoundField HeaderText="Cheque Details" DataField="CheqDetails"/>--%>
                            <asp:TemplateField HeaderText="Cheque Details" HeaderStyle-Width="100px">
                                <ItemTemplate>
                                    <asp:TextBox ID="txtCheqDetails" runat="server" Width="90%" Text="" CssClass="lbl"></asp:TextBox>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField HeaderText="Status" DataField="Status"/>
                            <asp:BoundField HeaderText="Verified By" DataField="VerifiedBy"/>
                            <asp:BoundField HeaderText="Verified Date" DataField="VerifiedDate"/>
                            <asp:TemplateField HeaderText="Banked Status" HeaderStyle-Width="50px">
                                <ItemTemplate>
                                    <asp:DropDownList ID="DropDownList7" runat="server" Width="100%" CssClass="lbl">
                                        <asp:ListItem Selected="True">Yes</asp:ListItem>
                                        <asp:ListItem>No</asp:ListItem>
                                    </asp:DropDownList>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Remarks">
                                <ItemTemplate>
                                    <asp:HyperLink ID="lnkRemarks" runat="server" NavigateUrl="~/Collection/TransactionRemarkDetails.aspx">Details</asp:HyperLink>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
                        <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
                        <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
                        <HeaderStyle BackColor="#ae5044" Font-Bold="True" ForeColor="#F7F7F7"  />
                        <EditRowStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" />
                        <AlternatingRowStyle BackColor="#cacbcf" />
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td align="center">
                    <asp:Label ID="Label3" runat="server" Text="Total For Cheque(Rs): "></asp:Label><asp:Label ID="lblChqAmt" runat="server" Text=""></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
            </tr>
                    </table>
                </td>
            </tr>
            <tr>
        <td>
             <table cellpadding="0" cellspacing="0">
                 <tr>
                     <td  id = "btnTXN" runat = "server">
                    <asp:Button ID="btnCancelTXN" runat="server" Text="Cancel TXN" CssClass="btn" OnClientClick="return DoConfirm();"
                        Height="23px" Width="82px" onclick="btnCancelTXN_Click"/>
                     </td>
                     <td >
                    <asp:Button ID="btnVerify" runat="server" Text="Verify" CssClass="btn" Height="23px" 
                             Width="82px" onclick="btnVerify_Click"/>
                     </td>
                     <td style="display:none"  >
                    <asp:Button ID="btnSave" runat="server" Visible="false" Text="Save" CssClass="btn" Height="23px" 
                             Width="82px" onclick="btnSave_Click"/>
                     </td>
                     <td>
                    <asp:Button ID="btnCancel" runat="server" Text="Cancel" CssClass="btn" 
                            Height="23px" Width="82px" onclick="btnCancel_Click"/>
                     </td>
                 </tr>
             </table>
                </td></tr>
        </table>
    
      </asp:Content>
      
      
      
      
      
    